package com.quyunshuo.module.home.fragment.compose

import android.media.tv.TvContract.Programs.Genres.MUSIC
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import com.quyunshuo.module.home.activity.main.SharedViewModel
import com.quyunshuo.module.home.music.Music
import com.quyunshuo.module.home.music.toMusicList

@Composable
fun LatelyMusicPage(vm:SharedViewModel, onPlay: (Music, Int) -> Unit,){
    val latelyMusicList by  vm.getLatelyMusic().collectAsState(emptyList())
    LocalMusicPage(latelyMusicList.toMusicList(),vm){music,index->
        onPlay.invoke(music,index)
    }
}